// 店铺账号

import request from '@/utils/request'
import R from '@/types/conduit/R'
import { ShopOrderPage } from '@/types/response/order'
import { ShopOrderPageParam, ShopRejectOrderParam } from '@/types/param/order'

export const selectShopOrderList = (shopOrderPageParam: ShopOrderPageParam): Promise<R<ShopOrderPage>> =>
  request({
    url: `/order/order/list-for-shop`, // user是Controller类上的路径，login是方法上的路径
    method: 'GET',
    params: shopOrderPageParam
  })
export const shopRejectOrder = (shopRejectOrderParam: ShopRejectOrderParam): Promise<R<null>> =>
  request({
    url: `/order/order/shop-reject-order`, // user是Controller类上的路径，login是方法上的路径
    method: 'POST',
    params: shopRejectOrderParam
  })
export const shopReceivingOrder = (orderId: number): Promise<R<null>> =>
  request({
    url: `/order/order/receiving-order/${orderId}`, // user是Controller类上的路径，login是方法上的路径
    method: 'POST'
  })

export const productionCompleted = (orderId: number): Promise<R<null>> =>
  request({
    url: `/order/order/production-completed/${orderId}`, // user是Controller类上的路径，login是方法上的路径
    method: 'POST'
  })
